$(document).ready(function () {
    de();
});

//登录传送方法
function de() {
    $.post("/dev/IndexServlet", null, function (data) {
        if (data == "null") {
            $(".la").text("请登录");
            $(".laa").hide();
            $(".laaa").hide();
            $(".hello").text("你好！")
        } else {
            $(".la").text(data);
            $(".laa").show();
            $(".laaa").show();
            $(".hello").text("欢迎你！");
        }
    });
}

//退出登录方法
function tui() {
    $(".alertW").show();

}

function cs1() {
    de();
    window.location.href = "/tj/index";
}

function qx1() {
    $(".alertW").hide();
}

function qd2() {
    $(".alertdl").hide();
}

function qd1() {
    $(".alertW").hide();
    $.post("/dev/TuiServlet", function () {
        $(".alertZx").show();
    });
}

//跳转
function login() {
    if ($(".la").text() == "请登录") {
        window.location.href = "/tj/login";
    } else {
        window.location.href = "/tj/userCenter";
    }
}

function login1() {
    window.location.href = "/tj/login";
}

function resgister() {
    window.location.href = "/tj/register";
}

function select() {
    window.location.href = "/tj/select";
}

function userCenter() {
    $.ajax({
        type: "GET",
        url: "/tj/checkUserCenter",
        dataType: "json",
        success: function (data) {
            if (data == "true") {
                window.location.href = "/tj/userCenter";
            } else {
                $(".alertdl").show();
            }
        }
        ,
        error: function (data) {
            alert("系统繁忙");
        }
    });

}